﻿@section head{

    <link rel="stylesheet"
          href="../../css/table.css" type="text/css">
    <script type="text/javascript"
            src="~/javascript/comm/comm.js">
    </script>
}

<!DOCTYPE html>
<body>
    <div id="app">
        <form id="form1" role="form">
            <table width="100%">
                <tr>
                    <td>
                        <font color="black">
                            您正在做的业务是：人力资源--客户化设置--人力资源档案管理设置--I级机构设置--I级机构添加
                        </font>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <input type="button" v-on:click="add" value="提交" class="BUTTON_STYLE1">
                        <input type="button" value="返回" class="BUTTON_STYLE1"
                               onclick="history.back();">
                    </td>
                </tr>
            </table>

            <table width="100%" border="1" cellpadding=0 cellspacing=1
                   bordercolorlight=#848284 bordercolordark=#eeeeee
                   class="TABLE_STYLE1">
                <tr>
                    <td width="19%" class="TD_STYLE1">
                        I级机构编号
                    </td>
                    <td width="81%" class="TD_STYLE2">
                        <input type="text" v-model="first_kind_id" id="first_kind_id" name="first_kind_id" class="INPUT_STYLE1" placeholder="请输入I级机构编号">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        I级机构名称
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" v-model="first_kind_name" id="first_kind_name" name="first_kind_name" class="INPUT_STYLE1" placeholder="请输入I级机构名称">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        薪酬发放责任人编号（多个编号之间请用"半角逗号"加"一个空格"隔开，如", "）
                    </td>
                    <td class="TD_STYLE2">
                        <textarea name="first_kind_salary_id" rows="4" id="first_kind_salary_id" v-model="first_kind_salary_id" class="TEXTAREA_STYLE1" placeholder="请输入薪酬发放责任人编号"></textarea>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        销售责任人编号（多个编号之间请用"半角逗号"加"一个空格"隔开，如", "）
                    </td>
                    <td class="TD_STYLE2">
                        <textarea name="first_kind_sale_id" rows="4" id="first_kind_sale_id" v-model="first_kind_sale_id" class="TEXTAREA_STYLE1" placeholder="请输入销售责任人编号"></textarea>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            first_kind_id: "",
            first_kind_name: "",
            first_kind_salary_id: "",
            first_kind_sale_id: ""
        },
        methods: {
            add: function () {
                var first_kind_id = $("#first_kind_id").val();
                var first_kind_name = $("#first_kind_name").val();
                var first_kind_salary_id = $("#first_kind_salary_id").val();
                var first_kind_sale_id = $("#first_kind_sale_id").val();
                if (first_kind_id == "") {
                    alert('请输入I级机构编号！');
                    return false;
                } else if (first_kind_name == "") {
                    alert('请输入I级机构名称！');
                    return false;
                } else if (first_kind_salary_id == "") {
                    alert('请输入薪酬发放责任人编号！');
                    return false;
                } else if (first_kind_sale_id == "") {
                    alert('请输入销售责任人编号！');
                    return false;
                }
                $.ajax({
                    url: "/client/first_kind_register",
                    type: "post",
                    data: $("#form1").serialize(),
                    success: function (msg) {
                        if (msg > 0) {
                            location.href = "/client/first_kind_register_success";
                        }
                    }
                });
            }
        }
    });
</script>

